home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / being there / Issues & Ideas / SGML / Kimber-on-HyQ-1.1 < prev    next >
Text File  |  1992-07-21  |  91KB  |  2,798 lines

  1. Sender: drmacro@vnet.ibm.com
  2. Message-Id: <9308030227.AA01688@relay1.UU.NET>
  3. Date: Mon, 2 Aug 93 22:27:36 EDT
  4. From: "W. Eliot Kimber" <drmacro@vnet.ibm.com>
  5. To: srn@techno.com
  6.  
  7.                                                          HYTIME AND SGML
  8.                                                        UNDERSTANDING THE
  9.                                                         HYTIME HYQ QUERY
  10.                                                                 LANGUAGE
  11.                                                                      1.1
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                                                           August 2, 1993
  20.  
  21.  
  22.                                                          W. Eliot Kimber
  23.  
  24.  
  25.                                             VNET:     DRMACRO at RALVM13
  26.                                           Internet: drmacro@vnet.ibm.com
  27.                                               IBMMAIL:  USIB2DK9@IBMMAIL
  28.                                                 Phone:    (919) 254-5160
  29.                                                                    Mail:
  30.                                                          IBM Corporation
  31.                                                      4205 S. Miami Blvd.
  32.                                     Research Triangle Park, NC 27709 USA
  33.                                                     Mail stop:  E14/B500
  34.  
  35.  
  36.                                                    IBM Internal Use Only
  37.  
  38.  
  39.  
  40.   FIRST EDITION
  41.  
  42.   You may copy this document freely as long as this copyright notice is
  43.   included without modification.
  44.  
  45.   (C) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1993.  ALL
  46.   RIGHTS RESERVED.
  47.   Note to U.S. Government Users -- Documentation related to restricted
  48.   rights -- Use, duplication or disclosure is subject to restrictions
  49.   set forth in GSA ADP Schedule Contract with IBM Corp.
  50.  
  51.  
  52.  
  53.   ------------------------------------------------------------------------------
  54.   About this Document
  55.  
  56.  
  57.      This document is intended to provide a brief, tutorial introduction to
  58.      the HyQ language.  It is assumed you have a working knowledge of SGML
  59.      and have a copy of the HyTime standard, ISO 10744 at hand, although it
  60.      does not assume you have more than a passing familiarity with HyTime.
  61.  
  62.  
  63.  
  64.   -----------
  65.   Conventions
  66.  
  67.  
  68.      Whenever a term defined in either the SGML standard, ISO 8879, or the
  69.      HyTime standard is used for the first time, it is highlighted like so:
  70.      SPECIALIZED TERM.  These terms represent the specialized jargon of
  71.      SGML and HyTime.  They have precise meanings that may be different
  72.      from their more common usage.
  73.  
  74.      The HyQ functions are defined using "railroad track" syntax diagrams
  75.      similar to the sort used in Pascal documentation.  To read a syntax
  76.      diagram, start at the left and follow the tracks, collecting
  77.      characters as you go, including any blanks.  A typical diagram looks
  78.      like this:
  79.  
  80.                                                       .- DEFAULT-.
  81.      >>--fubar(variable--.-----------.--.- CHOICE1-.--+----------+-------->
  82.                          '- OPTIONAL-'  '- CHOICE2-'  |- CHOICE1-|
  83.                                                       '- CHOICE2-'
  84.  
  85.                                 <-----------<
  86.      >--| Fragment Reference |--- REPEATABLE-----------------------------><
  87.  
  88.      Fragment references are references to other syntax diagrams presented
  89.      elsewhere.
  90.  
  91.  
  92.   -----------------------------
  93.   Assumptions Made for Examples
  94.  
  95.  
  96.      To keep the examples as brief as possible, not all the aspects of
  97.      HyTime that you would have in a real application are shown.  For
  98.      example, elements that are defined for the purpose of the examples are
  99.      not explicitly defined anywhere.  All elements used in examples that
  100.      are HyTime elements are presented as is.  Elements that are made-up
  101.      application-specific elements for the purposes of the examples are
  102.      always indicated as being made-up.
  103.  
  104.  
  105.   ------------------------
  106.   Accuracy of the Examples
  107.  
  108.  
  109.      I have made every effort to check the examples against the HyTime
  110.      standard.  Wherever I have had a question as to the proper
  111.      specification or use of a HyTime or HyQ construct I have asked for
  112.      clarification from Charles Goldfarb, the editor of the HyTime
  113.      standard, or Steve DeRose, one of the principle architects of the HyQ
  114.      language itself.  Any inaccuracies are mine.  If you find any
  115.      inaccuracies, or have any other comments on this document, please send
  116.      a note to the address shown on the title page.
  117.  
  118.  
  119.   ------------------------------------------------------------------------------
  120.   Acknowledgements
  121.  
  122.  
  123.      Special thanks to the following people who have provided invaluable
  124.      assistance in insuring the quality and accuracy of this information:
  125.  
  126.      o   Victoria Newcomb
  127.      o   Neill Kipp
  128.      o   Steve DeRose
  129.      o   Michael Sperberg-McQueen
  130.      o   Wayne Wohler
  131.      o   David Cattarin
  132.  
  133.  
  134.  
  135.   ------------------------------------------------------------------------------
  136.   Changes to This Document
  137.  
  138.  
  139. |    Changes to the latest version are marked with a vertical bar in the
  140. |    margin as this paragraph is.
  141.  
  142.      Changes for version 1.1, August 2, 1993:
  143.  
  144.      o   Fixed several errors in detail in various examples
  145.  
  146.      o   Fixed the TESTDOC example by adding missing ID= values and
  147.          explicitly ending all elements.
  148.  
  149.      o   Added to the description of property locations and fixed all the
  150.          Proploc() examples to match ISO 10744.
  151.  
  152.      o   Fixed technical errors in the description of Dataloc().
  153.  
  154.      o   Clarified the description of Listloc().
  155.  
  156.  
  157.  
  158.   ------------------------------------------------------------------------------
  159.   Introduction to HyTime and HyQ
  160.  
  161.  
  162.      HyTime is an ISO standard that defines an architecture for creating
  163.      hypertext and hypermedia applications.  HyTime primarily addresses the
  164.      problem of hyperlinking as a problem of addressing, in other words,
  165.      locating objects in space or time.  A key aspect of addressing is the
  166.      use of queries to find things based on their properties.
  167.  
  168.      HyTime is an SGML application, which means that it is designed using
  169.      SGML as the notation language and defines a number of functions
  170.      related directly to SGML constructs.  The HyTime standard defines the
  171.      HyQ query language as the recommended notation to use for queries
  172.      within a HyTime context.  HyQ is designed to directly reflect HyTime
  173.      constructs and addressing methods and is therefore optimized for use
  174.      within HyTime applications.  HyQ is not tied to any particular
  175.      retrieval or search engine and therefore represents an interchange
  176.      language for queries that would then be interpreted into concrete
  177.      queries using proprietary query languages or mechanisms.
  178.  
  179.      This document is an introduction to the HyQ language.  It shows how
  180.      the HyQ language is structured and how you use it to construct various
  181.      types of queries.  It also provides an overview of the various HyTime
  182.      addressing methods, as those are also used by HyQ.
  183.  
  184.      The last part of this document is a HyQ reference, containing a
  185.      reference page for each HyQ function.  This reference is intended to
  186.      supplement the HyQ definition in the HyTime standard itself by
  187.      providing examples and explanations of typical uses of each function.
  188.  
  189.  
  190.   ------------------------------------------------------------------------------
  191.   HyTime Addressing and HyQ
  192.  
  193.  
  194.      HyTime is about addressing.  HyTime works with objects in finite
  195.      coordinate spaces and objects within trees.
  196.  
  197.  
  198.   ---------------------
  199.   Coordinate Addressing
  200.  
  201.      Coordinate spaces are always defined in terms of quanta, in other
  202.      words, non-divisible integer units.  A one-dimensional coordinate
  203.      space can be represented as a number line, like so:
  204.  
  205.          1   2   3   4   5   6   7   8
  206.        |   |   |   |   |   |   |   |   |
  207.        |---+---+---+---+---+---+---+---+
  208.        |   |   |   |   |   |   |   |   |
  209.  
  210.      This coordinate space consists of eight quanta.  A two-dimensional
  211.      coordinate space can be represented by a matrix:
  212.  
  213.          +-----------------------------------------------+
  214.        5 |   |   |   |   |   |   |   |   |   |   |   |   |
  215.          |---+---+---+---+---+---+---+---+---+---+---+---|
  216.        4 |   |   |   |   |   |   |   |   |   |   |   |   |
  217.          |---+---+---+---+---+---+---+---+---+---+---+---|
  218.        3 |   |   |   |   |   |   |   |   |   |   |   |   |
  219.          |---+---+---+---+---+---+---+---+---+---+---+---|
  220.        2 |   |   |   |   |   |   |   |   |   |   |   |   |
  221.          |---+---+---+---+---+---+---+---+---+---+---+---|
  222.        1 |   |   |   |   |   |   |   |   |   |   |   |   |
  223.          +-----------------------------------------------+
  224.            1   2   3   4   5   6   7   8   9   10  11  12
  225.  
  226.      Locations within coordinate spaces are represented by sets of
  227.      DIMENSION SPECIFICATIONS.  A dimension specification, or dimspec, is
  228.      made up of two AXIS MARKERS, which are signed, non-zero integers.  The
  229.      first axis marker locates the starting quantum and the second axis
  230.      marker defines the extent (number of quanta) of the address.  The
  231.      start is the start of the location and is normally the quantum number
  232.      of the starting position.  The extent is the number of quanta to move
  233.      to define the length of the location on that axis.  Counting is always
  234.      done in the direction of the end of the finite coordinate space
  235.      (except in one special case explained below).
  236.  
  237.      For example, the dimension specification '1 1' indicates the first
  238.      quantum, '2 1' locates the second quantum, and '2 3' locates the
  239.      second through fourth quanta (start at quantum 2 and move over three
  240.      quanta).  A single dimension specification locates within a
  241.      one-dimensional coordinate space.
  242.  
  243.      When multiple axis marker pairs are used to address multiple locations
  244.      as though they were a single object, they are contained in a DIMENSION
  245.      LIST or dimlist.  The marker pairs within a given dimension list all
  246.      apply to a single axis in the addressible range.  You can think of a
  247.      dimspec as a special case of dimlist that only addresses a single
  248.      location.
  249.  
  250. |    Dimension specifications are used to locate within a single dimension
  251. |    or along a single axis.  but to locate within a multi-dimensional
  252. |    space, you create an extent, which contains a dimlist for each axis in
  253. |    the coordinate space and defines the extent of the region of the
  254. |    finite coordinate space being located.(1) To locate the first quantum
  255. |    in a matrix, you would specify '1 1'  '1 1'.  To locate a rectangular
  256. |    area two quanta by three quanta, you would specify the extent like so:
  257.  
  258. |      <extent>
  259. |       <dimlist>1 2</><dimlist>1 3</>
  260. |      </extent>
  261.  
  262. |    which would look like so:
  263.  
  264.        +---------------------------------------------------+
  265.      6 |   |   |   |   |   |   |   |   |   |   |   |   |   |
  266.        |---+---+---+---+---+---+---+---+---+---+---+---+---|
  267.      5 |   |   |   |   |   |   |   |   |   |   |   |   |   |
  268.        |---+---+---+---+---+---+---+---+---+---+---+---+---|
  269.      4 |   |   |   |   |   |   |   |   |   |   |   |   |   |
  270.        |---+---+---+---+---+---+---+---+---+---+---+---+---|
  271.      3 | x | x |   |   |   |   |   |   |   |   |   |   |   |
  272.        |---+---+---+---+---+---+---+---+---+---+---+---+---|
  273.      2 | x | x |   |   |   |   |   |   |   |   |   |   |   |
  274.        |---+---+---+---+---+---+---+---+---+---+---+---+---|
  275.      1 | x | x |   |   |   |   |   |   |   |   |   |   |   |
  276.        +---------------------------------------------------+
  277.          1   2   3   4   5   6   7   8   9   10  11  12  13
  278.  
  279.      extent="(1 2)  (1 3)"
  280.  
  281.      The area within a given coordinate space that a dimension
  282.      specification is actually addressing is called the ADDRESSABLE RANGE.
  283.      The addressable range always has well-defined boundaries, in other
  284.      words, a start and an end.  Knowing where the end of the addressable
  285.      range is lets you specify locations relative to the end of the range
  286.      as well as relative to the start of the range.
  287.  
  288.      The start and extent values have special meanings when a minus sign is
  289.      used with them.
  290.  
  291.      When the start quantum is negative, it indicates that counting starts
  292.      at the end of the addressable range rather than at the beginning.  For
  293.      example, the dimspec '-1 1' locates the last quantum in the range,
  294. |    while '-2 2' locates the last two quanta in the range.
  295.  
  296.      When the extent value is negative, it indicates that the extent is
  297.      from the end of the range, not the starting quanta.  For example, the
  298.      dimspec '1 -1' locates the entire range, while '2 -1 'locates all but
  299.      the first quanta in the range.  '2 -2' would locate all but the first
  300.      and last quanta in the range.
  301.  
  302.      When the first marker is negative and the extent is negative, it
  303.      indicates that the direction of counting is from the end of the range,
  304.      but starting from the second marker, not the end of the range.  In
  305.      other words, the first marker indicates the number of quanta to move
  306.      toward the start of the range, starting at the position indicated by
  307.      the second marker.  For example, in a range of ten quanta, the dimspec
  308.      '-3 -2' means the 7th through 9th quanta inclusive.  In other words,
  309.      locate the second quanta from the end of the marker (quantum nine)
  310.      then locate the third quanta in the direction of the start of the
  311.      range (quantum seven):
  312.  
  313.      Dimspec="-3 -2"
  314.                                          +--- Second quanta from end (-2)
  315.                                          V
  316.          1   2   3   4   5   6   7   8   9   10
  317.        |   |   |   |   |   |   | x | x | x |   |
  318.        |---+---+---+---+---+---+---+---+---+---|
  319.        |   |   |   |   |   |   | A |   |   |   |
  320.                                  +---- Third quanta from second marker (-3)
  321.  
  322.  
  323.      All this does is treat the end of the range as though it were the
  324.      start and the first marker as though it were the extent and the second
  325.      marker as though it were the starting quantum.
  326.  
  327. |    Another way to think of this is that when the signs of both markers
  328. |    are the same, then the first indicates a start location and the second
  329. |    indicates the number of quanta to move to the right (moving right -2
  330. |    is the same as moving left 2).
  331.  
  332.  
  333.   ----------------------------
  334.   Nodelist and Tree Addressing
  335.  
  336.  
  337.      HyTime also provides location mechanisms for locating objects within
  338.      trees.  In HyTime terms, a tree represents a hierarchical collection
  339.      of NODES, where a node is to a tree what a quantum is to a coordinate
  340.      space:  simply a way of defining where something is located in a tree.
  341.      Nodes can also be organized into lists, called NODE LISTS.  Nodes have
  342.      the special property that they can be the roots of trees.
  343.  
  344.      The typical use of tree locations in HyTime applications is to locate
  345.      elements within SGML documents, as SGML documents are always
  346.      hierarchical structures of elements and are therefore naturally
  347.      represented as trees(2).  Other types of data can be addressed as
  348.      trees or nodelists by providing notation handlers for those data
  349.      notations that can translate node and tree addresses into real
  350.      addresses for that data type.  For example, a notation handler for
  351.      PostScript data could allow addressing of pages in a PostScript
  352.      listing as nodes in a node list.  It is up to the implementer of a
  353.      given HyTime system to provide this sort of functionality.
  354.  
  355.      Nodes can thus be organized or viewed as members of node lists or
  356.      trees.  Nodes can be located by any one of the following location
  357.      mechanisms:
  358.  
  359.      o   Tree location address
  360.  
  361.      o   list location address
  362.  
  363.      o   path location address
  364.  
  365.      o   relative location address
  366.  
  367.      Node and tree locations are primarily used to locate elements within
  368.      SGML documents, but they can be used to locate within any type of data
  369.      that is represented as a tree or node list.
  370.  
  371.  
  372.   tree location address
  373.  
  374.  
  375.      Locates a node in a tree by selecting an ancestor node at each level
  376. |    of the tree.  E.g., the location '1 2 3 1' selects the first child of
  377.      the third child of the second child of the root.  Note that nodes are
  378.      counted in left-list preorder, e.g., top to bottom, left to right.
  379. |    Note also that the root node must always be identified in the tree
  380. |    location.
  381.  
  382.  
  383.   list location address
  384.  
  385.  
  386.      Address one or more nodes within a node list.  The list location is a
  387.      coordinate location where the coordinate space is a list of nodes.
  388.      For example, the list location '2 3' locates the second through fourth
  389.      nodes in a node list.
  390.  
  391.  
  392.   path location address
  393.  
  394.  
  395.      Locates one or more "paths" down a tree.  The path location address is
  396.      a coordinate location that addresses a tree as though it were a matrix
  397.      in which the rows are the levels of the tree and the matrix columns
  398.      are the paths down the tree.
  399.  
  400.      Consider the following tree:
  401.  
  402.                          +---+
  403.                          | A |
  404.                          +---+
  405.                 +----------+------------+
  406.                 |          |            |
  407.               +---+      +---+        +---+
  408.               | B |      | C |        | D |
  409.               +---+      +---+        +---+
  410.            +-------+       |        +-------+
  411.            |       |       |        |       |
  412.          +---+   +---+   +---+    +---+   +---+
  413.          | E |   | F |   | G |    | H |   | I |
  414.          +---+   +---+   +---+    +---+   +---+
  415.                    |
  416.                  +---+
  417.                  | J |
  418.                  +---+
  419.  
  420.      All the paths through the tree can be represented as a matrix where
  421.      each column is a path from the root to a leaf:
  422.  
  423.                       Paths
  424.                     1 2 3 4 5
  425.                     ---------
  426.        Level 1:     A A A A A
  427.        Level 2:     B B C D D
  428.        Level 3:     E F G H I
  429.        Level 4:     - J - - -
  430.  
  431.      Any single path can be located by specifying the column and then the
  432.      number of nodes within the column to select.  For example, the path
  433.      from A to J would be '2 1  1 -1'.  The first dimension, '2 1', locates
  434.      the second column.  The second dimension locates the entire length of
  435.      the column.
  436.  
  437.  
  438.   relative location address
  439.  
  440.  
  441.      Addresses nodes in a tree based on their genealogical relationship to
  442.      another node in the tree.  You locate the position of the node the
  443.      other nodes are relatives of, specify the general relationship that
  444.      the target nodes have (e.g., child, ancestor, elder sibling, younger
  445.      sibling, descendant).  The relationship specification effectively
  446.      defines the node list or pathlist within which the target nodes are
  447.      located.  You then specify a coordinate location locating the actual
  448.      nodes.  For example, to locate the third child of the root of a
  449.      document you would specify this relative location address:
  450.  
  451.        <relloc id=sample-relloc
  452.                relation=children>3 1</relloc>
  453.  
  454.      The root of the relative location is, by default, the root of the
  455.      document.  The relation 'children' defines the target domain as the
  456.      node list consisting of all direct children of the root.  The
  457.      dimension specification '3 1' locates the third node within the node
  458.      list, effectively locating the third child of the root.
  459.  
  460.  
  461.   ------------------
  462.   Semantic Locations
  463.  
  464.  
  465.      Semantic locations provide means of locating aspects of objects that
  466.      are unique to their semantic roles, as opposed to their structural
  467.      roles.  Semantic location methods are:
  468.  
  469.      o   Property locations (proploc).  Proploc locates values of object
  470.          properties, such as attribute values and generic identifiers.
  471.          Non-SGML data notations can have properties defined for them using
  472.          the HyTime property definition constructs.
  473.  
  474.      o   Notation-specific locations (notloc).  Notloc locates into data in
  475.          a given notation using addressing methods specific to that
  476.          notation, as opposed to using normal HyTime addressing that is
  477.          interpreted by a notation processor that understands HyTime
  478.          addressing.
  479.  
  480.      o   Bibliographic locations (bibloc).  Bibloc locates elements that
  481.          are not directly addressable by the system, normally references to
  482.          real objects, such as printed books, people, and the like.
  483.  
  484.      Proploc is the semantic location method used most often.  Notloc is a
  485.      sort of "escape" that allows addressing into data notations for which
  486.      generalized HyTime support has not been provided.
  487.  
  488.  
  489.   Property Location Addressing
  490.  
  491.  
  492.      SGML elements have properties as defined by ISO 8879, e.g., the
  493.      generic identifier and any declared attributes.  In addition,
  494.      application designers may define other properties for elements or for
  495.      other data types.  Property definition is done in HyTime using the
  496.      HyTime property definition element form, defined in Annex A.2.  You
  497.      can define new properties and given them names by which they can be
  498.      referred to from a proploc.
  499.  
  500.      To refer to element attributes within a proploc, you specify the
  501.      property name 'ATTVAL' followed by the attribute name, separated by a
  502.      null end tag (NET) delimiter (normally a solidus ([], like so:
  503.  
  504.        <HyQ>
  505.        proploc(DOMROOT ATTVAL[SECURITY])
  506.        </HyQ>
  507.  
  508. |    The string ATTVAL[SECURITY]' is a qualified property name (qpn), made
  509. |    up of the following parts:(3) 'ATTVAL' identifies the property itself,
  510. |    in this case, an attribute value.  '[SECURITY]' defines the specifier
  511. |    for the property, in this case, the attribute name.  A specifier
  512. |    defines the data that allows for selection among properties of the
  513. |    same type.  In this example, the attribute name is the specifier for
  514. |    selecting among the values of the various attributes of the element
  515. |    being located.  Without the specifier, the proploc() would return the
  516. |    values of all the attributes.  The syntax of qualified property names
  517. |    of this form is defined in section A.1.3 Useful Hylex Types in ISO
  518. |    10744.
  519.  
  520. |    All property names are specified relative to a defined set of
  521. |    properties, called a property set.  For all standard SGML and HyTime
  522. |    constructs, these properties are part of the standard property sets
  523. |    used by default.  However, you can specify the property set name
  524. |    explicitly, like so:
  525.  
  526. |      <HyQ>
  527. |      proploc(DOMROOT HTsem1+ATTVAL[SECURITY])
  528. |      </HyQ>
  529.  
  530. |    'HTsem1' identifies the property set in which the named property is
  531. |    defined.  The standard property sets are defined in section A.2.1 of
  532. |    ISO 10744.
  533.  
  534.      Thus the proploc() function in this example returns the value of the
  535.      attribute.  If the actual markup is:
  536.  
  537.        <mydoc security="iuo">
  538.  
  539.      Then the query would return the value 'iuo'.
  540.  
  541.      The special keyword GI refers to the generic identifier property of
  542.      the element.  Applied to the markup above, the following query returns
  543.      'mydoc'.(4)
  544.  
  545.        <HyQ>
  546.        proploc(DOMROOT GI)
  547.        </HyQ>
  548.  
  549. |    If you are going to need to specify the same long qualified property
  550. |    name many times, it may be convenient to define a property name
  551. |    synonym for it.  For example, the value of the ID= attribute is a
  552. |    property that is use frequently, so it would make sense to define a
  553. |    synonym for it, something like this:
  554.  
  555. |      <HyPD psn=myprops syn pn=idatt>
  556. |      HTsem1+ATTVAL[ID]
  557. |      </HyPD>
  558.  
  559. |    The property set name 'myprops' must be declared as a notation and
  560. |    represents a set of properties defined locally (for example, within
  561. |    the metadtd for an application architecture or the concrete DTD of an
  562. |    SGML application).  Having defined this synonym, you can now use the
  563. |    property name directly and simply:
  564.  
  565. |      proploc(CAND myprops+idatt)
  566.  
  567. |    You can also specify property set names on elements that contain the
  568. |    query using the qpnpsn= attribute (defined as one of the all-qual
  569. |    qualifying name attributes in section 6.7.3 of ISO 10744).  This
  570. |    allows you to specify the names of property sets to be searched to
  571. |    find the definitions of various property names, eliminating the need
  572. |    to explicitly specify property set names.  For example, the above
  573. |    proploc() could be changed to this, within the context of a HyQ
  574. |    element:
  575.  
  576. |      <HyQ qpnpsn=myprops>
  577. |      proploc(CAND idatt)
  578. |      </hyq>
  579.  
  580.  
  581.  
  582.   Notation Location Addressing
  583.  
  584.  
  585.      Notation locations are location address specifications unique to a
  586.      particular data notation, rather than being standard HyTime dimension
  587.      references or queries.  Notation locations must be used to address
  588.      into data notations for which a HyTime-knowledgeable notation
  589.      processor is not available.
  590.  
  591.      The main problem with notation locations is that they are directly
  592.      tied a specific notation and are thus not very interchangeable.
  593.  
  594.      In a pure HyTime system, for each supported notation there would be at
  595.      least one notation processor that would accept standard HyTime address
  596.      (dimension specifications or data locations, for example) and would
  597.      know how to transform the HyTime specification into real locations in
  598.      the specific data notation.  For example, say you wanted to address
  599.      words in text regardless of the format that text is stored in, because
  600.      it could be in any one of several proprietary formats.  If each format
  601.      has a HyTime notation processor available, you could use a simple data
  602.      location address with a defined quanta of WORD without having to worry
  603.      about how to actually find words in the actual data, because the
  604.      notation processor would handle that transparently.
  605.  
  606.      However, if there was a format for which there was no
  607.      HyTime-knowledgeable notation processor, to address words, you might
  608.      have to specify the address in the specific notation.  For text in a
  609.      given word processor format, that might mean specifying the editor
  610.      macros that would return what you want as the address, say something
  611.      like this:
  612.  
  613.        <notloc notation=PandaWord>
  614.        @macro(find_mark("fubar"), start_select(), move_word(3), end_select(),
  615.               copy(), return(clipboard()))
  616.        </notloc>
  617.  
  618.      Compare with the equivalent dataloc:
  619.  
  620.        <dataloc locsrc=fubar quantum=word>1 3</dataloc>
  621.  
  622.      HyQ does not provide a notation location function, but you could use a
  623.      notloc indirectly by using the object-of function (oo()) to refer to
  624.      the notloc element that addresses the objects you need.
  625.  
  626.  
  627.   Bibliographic Location Addressing
  628.  
  629.  
  630.      Bibliographic locations address objects that are not directly
  631.      addressable by the computer system or application.  For example, you
  632.      could create a "hyperlink" to a document that only exists in print by
  633.      using a bibliographic location giving its Library of Congress number.
  634.  
  635.      Bibliographic locations cannot be used as location sources, so they
  636.      cannot be used within HyQ queries.
  637.  
  638.  
  639.   ------------------------------------------------------------------------------
  640.   Getting Started with HyQ
  641.  
  642.  
  643.      HyQ is a language for use with HyTime location addressing facilities.
  644.      It represents a sort of "API" by which computer systems can interact
  645.      with HyTime systems using HyTime location mechanisms.  For example, a
  646.      database retrieval system might use HyQ queries to locate data within
  647.      an SGML database, or an online presentation system might use HyQ
  648.      queries to interact with other online systems through a HyTime engine.
  649.  
  650.      HyQ queries can also be used within HyTime location elements that
  651.      allow queries, such as the NMQuery element used within named address
  652.      location elements (nameloc).  The HyQ language is defined within Annex
  653.      A of the HyTime Standard.
  654.  
  655.  
  656.   ----------
  657.   HyQ Basics
  658.  
  659.  
  660.      HyQ operates on and returns node lists.  The set of nodes against
  661.      which the query is performed is called the QUERY DOMAIN.  This query
  662.      domain is defined by specifying the node that forms the root of the
  663.      tree containing the target nodes.  For example, to locate elements
  664.      within an SGML document, you would specify the root node of the
  665.      document (the DOCUMENT ELEMENT) as the domain root.
  666.  
  667.      The HyQ language itself is a lisp-like language where queries are
  668.      specified by nesting HyQ functions within other functions.  A typical
  669.      HyQ query is:
  670.  
  671.        <HyQ qdomain=mydocument>
  672. |        Select(DOMTREE EQ(Proploc(CAND GI) "CHAPTER"))
  673.        </HyQ>
  674.  
  675.      The HyQ element contains the query itself; the qdomain= attribute
  676.      identifies the query domain (the root node of the tree against which
  677.      the query is performed).  In this example, pointing to the document
  678.      element for an document called mydocument.  By default, the query
  679.      domain for a HyQ query is the current SGML document.
  680.  
  681.      Function parameters are blank-delimited, with literal strings enclosed
  682.      in single or double quotes.  A query can include variable arguments
  683.      that are passed in as values of the ARGS= attribute of the HyQ
  684.      element.
  685.  
  686.      The following keywords have special meaning within a HyQ query:
  687.  
  688.      DOMROOT Refers to the root node list of the query.
  689.  
  690.      DOMTREE Refers to the tree of nodes rooted at DOMROOT.
  691.  
  692.      CAND    Refers to the candidate under test in a select() function.
  693.              The select() function takes a node list and an assertion and
  694.              applies the assertion to each member of the node list in turn.
  695.              The keyword CAND can be used within the assertion to refer to
  696.              the current candidate node.  The select() function returns a
  697.              node list containing the candidates for which the assertion
  698.              was true.
  699.  
  700.      For example, in the HyQ query shown above, the select's input node
  701.      list is defined as the DOMTREE, in other words, all nodes in the query
  702.      domain.  The assertion is asking if the candidate's GI value (tag
  703.      name) is equal to the value 'Chapter'.  The select then returns a
  704.      nodelist containing each node that does have a GI of 'Chapter'.  In
  705.      the context of this query, the nodes are SGML elements.
  706.  
  707.      The essential question in this query is "is the GI equal to
  708.      'Chapter'?"  To answer this question, you must first find out for each
  709.      node in the query domain what its GI is, thus the proploc() function,
  710.      which returns the value of a property, in this case, the GI property:
  711.      "Proploc(CAND GI)".  Remember that the CAND keyword refers to the
  712.      current candidate node from the node list specified for the select()
  713.      function.
  714.  
  715.      Having the GI for each candidate node, you now compare it to the
  716.      literal string 'Chapter' using the EQ() function.  The EQ() function
  717.      compares the first parameter and the second parameter and returns TRUE
  718.      if they are equal.  This true or false value is then used by the
  719.      select() function to determine which of the nodes in the input node
  720.      list to return.
  721.  
  722.      To test this query, try applying it to the following sample document:
  723.  
  724.        <testdoc id=a>
  725.        <body id=b>
  726.        <Chapter id=intro-chap><title id=e>Introduction</title>
  727.        <p id=c>Introduction</p>
  728.        <Chapter id=complex><title id=f>Complex Stuff</title>
  729.        <p id=d>This is about complex stuff.</p>
  730.        </body>
  731.        </testdoc>
  732.  
  733.      The outermost function is:
  734.  
  735.        select(DOMTREE assertion)
  736.  
  737.      The keyword DOMTREE represents the node list of all elements in the
  738.      document, rooted at the document element (<testdoc> in this case).
  739.      For this exercise, represent this node list by listing the IDs of the
  740.      elements:
  741.  
  742. |      "a b intro-chap e c complex f d"
  743.  
  744.      The assertion is then applied to each member of the node list.
  745.  
  746.      To work the assertion, start from the inside out.  The lowest level
  747.      function returns the GI of each candidate node using the proploc()
  748.      function:
  749.  
  750.        proploc(CAND GI)
  751.  
  752.      For the first node in node list (element with ID=a), proploc returns
  753.      'testdoc'.
  754.  
  755.      The next layer is the EQ() function to see if the GI is equal to the
  756.      string 'Chapter':
  757.  
  758.        EQ(CAND proploc(CAND GI) "CHAPTER")
  759.  
  760.      For the first candidate (taken from the node list supplied for the
  761.      select), the element with ID=a, the result of the EQ is FALSE because
  762.      'testdoc' is not equal to 'Chapter'.  Thus, the candidate is not put
  763.      into the node list returned by the select() function.
  764.  
  765.      Repeat the above steps for each node in the node list.  The node list
  766.      returned by the select() should be:
  767.  
  768.        "intro-chap complex"
  769.  
  770.      Note that for this example you've used the IDs of the elements to
  771.      represent the node list.  In a real system, the node list would
  772.      actually contain pointers to the SGML elements themselves, rather than
  773.      a literal list of element IDs.  This is an important distinction to
  774.      keep in mind because a node list can be a set of literal values.  For
  775.      example, consider this query:
  776.  
  777.        <HyQ>
  778.         proploc(DOMTREE ATTVAL[ID])
  779.        </HyQ>
  780.  
  781.      This query uses the proploc() function to return for each node in
  782.      DOMTREE the value of the ID= attribute, resulting in a node list that
  783.      is a set of literal ID values.
  784.  
  785.      It is important to keep in mind the type of data each HyQ function
  786. |    returns.  HyQ functions return one of three types of data:  Boolean
  787. |    values (true or false), node lists, or literal data.  All the
  788. |    assertion functions return Boolean values.  Dataloc() and proploc()
  789. |    return literal data, and all other functions return node lists.  Note
  790. |    that literal data strings can be the nodes in a node list.  For
  791. |    example, a proploc() that operates against each of the nodes in a node
  792. |    list will itself return a node list of literal values, one for the
  793. |    property value for each node in the input node list.
  794.  
  795.      These are simple examples, but they demonstrate the basic approach to
  796.      using HyQ to locate objects and get information about objects.
  797.  
  798.  
  799.   ----------------------
  800.   Defining HyQ Functions
  801.  
  802.  
  803.      You can define HyQ functions to capture common queries that can be
  804.      re-used.  To create a HyQ function, you create a HyQ element with an
  805.      FN= attribute.  The FN= attribute defines the function name for this
  806.      function:
  807.  
  808.        <HyQ fn=HasGI><!-- Returns elements in DOMTREE with specified GI -->
  809.          Select(DOMTREE EQ(proploc(CAND GI) %1))
  810.        </HyQ>
  811.  
  812.      The '%1' is a variable parameter.
  813.  
  814.      You use a function one of two ways.  You can refer to a function
  815.      directly from the HyQ element by using the UseFN= and Args= attributes
  816.      to refer to a previously-defined function:
  817.  
  818.        <HyQ usefn=HasGI args="P"><!-- Find all elements with GI 'P' -->
  819.  
  820.      When you specify the UseFN= attribute, the HyQ element is empty and
  821.      cannot have an end tag specified.
  822.  
  823.      You can also use a function within another HyQ query using the UseQ()
  824.      function to name the function and pass the arguments:
  825.  
  826.        <HyQ>
  827.        UseQ(HasGI "P")
  828.        </HyQ>
  829.  
  830.      The parameters are substituted in the order specified on the Args=
  831.      attribute or in the UseQ() function.  Parameters for which no value
  832.      was specified are empty.
  833.  
  834.  
  835.   ------------------------------------------------------------------------------
  836.   The HyQ Primitive Operations
  837.  
  838.  
  839.      This section defines each of the HyQ primitive functions.  The
  840.      description of each function contains a formal definition of its
  841.      parameters, a general description of what the function does, and some
  842.      examples of how it might be used.
  843.  
  844.      This information is taken directly from Annex A of ISO 10744.
  845.  
  846.      The functions are in alphabetical order by function name.  The
  847.      following entries group the various related funcions together:
  848.  
  849.      NODE      Lists the constructs that are valid wherever a node is
  850.                valid.
  851.  
  852.      NODE LIST Lists the constructs that are valid wherever a node list is
  853.                valid.
  854.  
  855.      ASSERTION Lists the functions that provide Boolean operations or
  856.                logical comparisons.
  857.  
  858.      NLOPS     Lists functions that operate against node lists
  859.  
  860.      NLDEFS    Lists functions that define or create node lists
  861.  
  862.  
  863.  
  864.   ------------------------------------------------------------------------------
  865.   ah()
  866.   User-defined assertion handler
  867.  
  868.  
  869.   Syntax
  870.  
  871.  
  872.      >>--ah(idref -| Node List |-)---------------------------------------><
  873.  
  874.      idref
  875.          Refers to the object that implements the assertion.
  876.  
  877.      NODE LIST
  878.          The node list contains the operands of the assertion.  The meaning
  879.          of the operands is defined by the assertion implementation.
  880.  
  881.  
  882.  
  883.   Purpose
  884.  
  885.  
  886.      The assertion handler function allows you to define and implement
  887.      assertions that the base HyQ definition does not provide.
  888.  
  889.  
  890.   Examples
  891.  
  892.  
  893.      In the following example, the ID reference is to an
  894.      application-defined element that contains a Rexx function that
  895.      implements the assertion.
  896.  
  897.        <assertion-function id=compare-objects>
  898.        /* Rexx Function */
  899.        Compare_Objects:
  900.        procedure
  901.        arg objectname fieldname comparison_value .
  902.  
  903.        interpret "IF "objectname"."fieldname "== comparison_value ",
  904.                      "THEN return(1) ELSE return(0)"
  905.        return(0) /* just in case */
  906.        </assertion-function>
  907.          .
  908.          .
  909.          .
  910.        <HyQ>
  911.        select(DOMTREE ah(compare-objects ("mystem" "0owner" "DRMACRO")))
  912.        </HyQ>
  913.  
  914.      In this example, the DOMTREE would be defined to be the set of Rexx
  915.      stemmed variables the assertion is applied against.  The node list of
  916.      parameters for the Compare_Objects() Rexx function results in the
  917.      following IF statement being executed as a result of applying the
  918.      interpret operation:
  919.  
  920.        IF mystem.0owner == comparison_value
  921.           THEN return(1) ELSE return(0)
  922.  
  923.      The Rexx variable comparison_value has the value 'DRMACRO' in this
  924.      case.
  925.  
  926.  
  927.   ------------------------------------------------------------------------------
  928.   and()
  929.   Test Boolean AND
  930.  
  931.  
  932.  
  933.   Syntax
  934.  
  935.  
  936.               <---------------<
  937.      >>--and(---| Assertion |---)----------------------------------------><
  938.  
  939.      ASSERTION
  940.          Any of the HyQ assertion functions.
  941.  
  942.  
  943.  
  944.   Purpose
  945.  
  946.  
  947.      And() returns TRUE only when all assertions return TRUE.
  948.  
  949.  
  950.   Examples
  951.  
  952.  
  953.      In this example, And() is used to see if two properties have a certain
  954.      combination of values:
  955.  
  956.        <HyQ>
  957.         select(DOMTREE AND(EQ(proploc(CAND ATTVAL[STATUS]) "CHANGED")
  958.                            EQ(proploc(CAND ATTVAL[VERSION]) "V1R2")))
  959.        </HyQ>
  960.  
  961.      The AND() in this case contains two EQ() assertions.  Each EQ()
  962.      compares the value of an attribute with a string and returns TRUE or
  963.      FALSE based on the match.  The AND() function will return TRUE if both
  964.      EQ() functions return TRUE, otherwise it will return FALSE.
  965.  
  966.      Thus the select() function will return a node list containing each
  967.      element in DOMTREE for which STATUS equals 'CHANGED' and VERSION
  968.      equals 'V1R2'.
  969.  
  970.  
  971.   ------------------------------------------------------------------------------
  972.   assert()
  973.   Test assertion
  974.  
  975.  
  976.  
  977.   Syntax
  978.  
  979.  
  980.      >>--assert(-.-TRUE----------.-)-------------------------------------><
  981.                  |-FALSE---------|
  982.                  '-| Assertion |-'
  983.  
  984.      TRUE
  985.      FALSE
  986.      ASSERTION
  987.          The Boolean value to assert (TRUE or FALSE) or an assertion
  988.          function that will return either TRUE or FALSE.
  989.  
  990.  
  991.  
  992.   Purpose
  993.  
  994.  
  995.      Returns TRUE or FALSE.
  996.  
  997.  
  998.   Examples
  999.  
  1000.  
  1001.      In this trivial example, the Assert() function causes the select()
  1002.      function to always return the input node list:
  1003.  
  1004.        <HyQ>
  1005.        select(DOMTREE assert(TRUE))
  1006.        </HyQ>
  1007.  
  1008.  
  1009.  
  1010.   ------------------------------------------------------------------------------
  1011.   assertion
  1012.   Functions that return TRUE or FALSE
  1013.  
  1014.  
  1015.  
  1016.   Syntax
  1017.  
  1018.  
  1019.      ASSERTION:
  1020.      |--assert(-.-| assert() |--.-)---------------------------------------|
  1021.                 |-| ah() |------|
  1022.                 |-| compare() |-|
  1023.                 |-| ordered() |-|
  1024.                 |-| and() |-----|
  1025.                 |-| or() |------|
  1026.                 |-| not() |-----|
  1027.                 |-| forall() |--|
  1028.                 '-| exists |----'
  1029.  
  1030.  
  1031.   Purpose
  1032.  
  1033.  
  1034.      All the assertion functions return TRUE or FALSE.  Use assertion
  1035.      functions within select() or within any function that takes an
  1036.      assertion as an argument.
  1037.  
  1038.      Note that exists is not a function, but is merely a property of node
  1039.      lists such that when a node or node list occurs where an assertion is
  1040.      expected, the node evaluates to TRUE if it is non-empty, FALSE if it
  1041.      is empty.
  1042.  
  1043. |    For example, the following And() function returns TRUE because
  1044. |    assign() always returns true and the node list referenced by nlref()
  1045. |    is not empty (having been assigned a non-null value):
  1046.  
  1047. |      <HyQ>
  1048. |      and(assign(notempty ("has a value"))
  1049. |          nlref(notempty)
  1050. |         )
  1051. |      </HyQ>
  1052.  
  1053.  
  1054.  
  1055.   ------------------------------------------------------------------------------
  1056.   assign()
  1057.   Assign a local name to a node list
  1058.  
  1059.  
  1060.  
  1061.   Syntax
  1062.  
  1063.  
  1064.      >>--assign(name -| Node List |-)------------------------------------><
  1065.  
  1066.      name
  1067.          The symbolic name to be assigned to the node list.  The name is
  1068.          available to the entire HyQ query body and any nested queries.
  1069.          The name cannot be re-defined within the scope of a single query.
  1070.  
  1071.      NODE LIST
  1072.          The node list to which the name is being assigned.
  1073.  
  1074.  
  1075.  
  1076.   Purpose
  1077.  
  1078.  
  1079.      Use Assign() to assign a symbolic name to a node list as a convenience
  1080.      in specifying other parts of a query.  Use the nlref() function to use
  1081.      a node list name created with assign().
  1082.  
  1083.  
  1084.   Examples
  1085.  
  1086.  
  1087.      In this example, assign() is used to assign a name to the node list
  1088.      representing the elder siblings of a node:
  1089.  
  1090.        <HyQ>
  1091.        ASSIGN(ElderSiblings relloc(DOMTREE oo(an-element) esib (1 -1)))
  1092.        select(nlref(ElderSiblings) EQ(proploc(CAND GI) "P"))
  1093.        </HyQ>
  1094.  
  1095.      The relloc() function defines the node list by locating all elder
  1096.      siblings of the element with the ID of 'an-element'.  This named node
  1097.      list is then used in the select() function to return the list of
  1098.      elements within the list of elder siblings that have a GI of 'P'.
  1099.  
  1100.  
  1101.   ------------------------------------------------------------------------------
  1102.   count()
  1103.   Return number of quanta in range
  1104.  
  1105.  
  1106.  
  1107.   Syntax
  1108.  
  1109.  
  1110.      >>--count(-| Node List |--.----------.-)----------------------------><
  1111.                                '- quantum-'
  1112.  
  1113.  
  1114.   Purpose
  1115.  
  1116.  
  1117.  
  1118.  
  1119.   Examples
  1120.  
  1121.  
  1122.      This example extends the example for assign by using Count() to return
  1123.      the number of elder P siblings of the element with the ID
  1124.      'an-element':
  1125.  
  1126.        <HyQ>
  1127.        assign(ElderSiblings relloc(DOMTREE oo(an-element) esib (1 -1)))
  1128.        COUNT(select(nlref(ElderSiblings) EQ(proploc(CAND GI) "P")))
  1129.        </HyQ>
  1130.  
  1131.  
  1132.  
  1133.   ------------------------------------------------------------------------------
  1134.   compare()
  1135.   Tests ordering of nodes in lists
  1136.  
  1137.  
  1138.  
  1139.   Syntax
  1140.  
  1141.  
  1142.                               .- STR--.  <- --------------------<
  1143.      >>--compare(--.-EQ-.--(--+-------+----.-| Node |------.--)----------><
  1144.                    |-NE-|     |- NORM-|    '-| Node List |-'
  1145.                    |-LT-|     |- WORD-|
  1146.                    |-LE-|     |- NAME-|
  1147.                    |-GT-|     |- SINT-|
  1148.                    |-GE-|     |- DATE-|
  1149.                    |-SS-|     |- TIME-|
  1150.                    |-NS-|     '- UTC--'
  1151.                    |-ST-|
  1152.                    |-SE-|
  1153.                    |-BT-|
  1154.                    |-BE-|
  1155.                    |-HO-|
  1156.                    |-HE-|
  1157.                    |-IH-|
  1158.                    '-IE-'
  1159.  
  1160.      comparison operator
  1161.          Defines the type of comparison to be performed.
  1162.  
  1163.      COMPARISON OPERATORS
  1164.          The following comparison operators can be used to specify the type
  1165.          of comparison to perform against the members of the node list:
  1166.  
  1167.          EQ
  1168.              All members are equal to each other.
  1169.  
  1170.          NE
  1171.              AT least two operands are not equal.
  1172.  
  1173.          LT
  1174.              Each operand is less than its successor.
  1175.  
  1176.          LE
  1177.              Each operand is less than or equal to its successor.
  1178.  
  1179.          GT
  1180.              Each operand is greater than its successor.
  1181.  
  1182.          GE
  1183.              Each operand is greater than or equal to its successor.
  1184.  
  1185.          SS
  1186.              All operands are the same size (same number of quanta)
  1187.  
  1188.          NS
  1189.              At least two operands are not the same size.
  1190.  
  1191.          ST
  1192.              Each operand is smaller (shorter) than its successor.
  1193.  
  1194.          SE
  1195.              Each operand is smaller (shorter) than or equal to its
  1196.              successor.
  1197.  
  1198.          BT
  1199.              Each operand is bigger (longer) than its successor.
  1200.  
  1201.          BE
  1202.              Each operand is bigger (longer) than or equal to its
  1203.              successor.
  1204.  
  1205.          HO
  1206.              Each operand holds its successor (proper superstring)
  1207.  
  1208.          HE
  1209.              Each operand holds or equals its successor (superstring)
  1210.  
  1211.          IH
  1212.              Each operand is held by its successor (proper substring)
  1213.  
  1214.          IE
  1215.              Each operand is held by or equals its successor (substring)
  1216.  
  1217.      QUANTUM
  1218.          Represents the Quantum= attribute of the dataloc form.  This value
  1219.          defines what constitutes a quantum in the data.  Valid values are:
  1220.  
  1221.          NORM
  1222.              Normalized text:  all characters except record start (RS),
  1223.              record end (RE), and separation characters (SEPCHAR), normally
  1224.              space and tab.
  1225.  
  1226.          WORD
  1227.              Word tokens:  all name characters.
  1228.  
  1229.          NAME
  1230.              SGML name:  NAME constructed according to ISO 8879.
  1231.  
  1232.          SINT
  1233.              Signed integer:  digit string, optionally preceded by a hyphen
  1234.              or plus.
  1235.  
  1236.          DATE
  1237.              UTC date:  valid date in UTC yyy-mm-dd format.
  1238.  
  1239.          TIME
  1240.              UTC time:  valid time in UTC hh:mm:ss.decimal format.
  1241.  
  1242.          UTC
  1243.              UTC date and time: pairs of DATE and TIME tokens, DATE first.
  1244.  
  1245.          STR
  1246.              The data quantum is a bit combination ("character") and the
  1247.              addressable range is viewed as a string.  There is no
  1248.              filtering or normalization.  Addressing is always in terms of
  1249.              complete bit combinations.
  1250.  
  1251.      NODE
  1252.      NODE LIST
  1253.          The node or nodes to be compared to each other using the specified
  1254.          comparison.
  1255.  
  1256.  
  1257.  
  1258.   Purpose
  1259.  
  1260.  
  1261.      Use Compare() to compare the members of a node list to each other
  1262.      using a comparison.  Comparisons are done in a way appropriate for the
  1263.      quantum.
  1264.  
  1265.  
  1266.   Examples
  1267.  
  1268.  
  1269.      This simple example uses compare to confirm that the node list
  1270.      returned by the query in the example for assign() is really made up
  1271.      only of P elements.  In this example, the HyQ query is contained
  1272.      within a made-up element called TrueOrFalse.  For the purpose of this
  1273.      example, assume that the purpose of the TrueOrFalse element is to
  1274.      contain a query that will return either TRUE or FALSE and that the
  1275.      result of the query will be taken as the data of the TrueOrFalse
  1276.      element.  Note the Notation= attribute indicating that the data
  1277.      contained by the TrueOrFalse element is a HyQ query.
  1278.  
  1279.        <TrueorFalse notation=HyQ>
  1280. |      and(
  1281. |      assign(nlref(ElderSiblings) relloc(DOMTREE oo(an-element) esib (1 -1)))
  1282. |      compare(EQ select(ElderSiblings EQ(proploc(CAND GI) "P"))
  1283. |      )
  1284.        <TrueorFalse>
  1285.  
  1286.  
  1287.  
  1288.   ------------------------------------------------------------------------------
  1289.   create()
  1290.   Create a node list
  1291.  
  1292.  
  1293.  
  1294.   Syntax
  1295.  
  1296.  
  1297.                        <- -----------------<
  1298.      >>---.--------.-(---.-| Node |------.---)---------------------------><
  1299.           '-create-'     '-| Node List |-'
  1300.  
  1301.      NODE
  1302.          Node List
  1303.          The node or nodes making up the node list.
  1304.  
  1305.  
  1306.  
  1307.   Purpose
  1308.  
  1309.  
  1310.      Use the Create() function to create a node list, such as a list of
  1311.      literal values.  The function name can be omitted.  This means that
  1312.      any group of valid nodes will be interpreted as a node list when
  1313.      surrounded by parentheses any place a node list is valid.
  1314.  
  1315.  
  1316.   Examples
  1317.  
  1318.  
  1319.      In this simple example, the create() function is used to create two
  1320.      lists of literals for the diff() function.  The second node list
  1321.      demonstrates how the create name can be omitted:
  1322.  
  1323.        <HyQ>
  1324.        diff(CREATE("id-a" "id-b" "id-c") ("id-a" "id-c" "id-d"))
  1325.        </HyQ>
  1326.  
  1327.  
  1328.  
  1329.   ------------------------------------------------------------------------------
  1330.   dataloc()
  1331.   Select data from nodes
  1332.  
  1333.  
  1334.  
  1335.   Syntax
  1336.  
  1337.  
  1338.                                   .- STR--.  .- NOCATSRC-.
  1339.      >>--dataloc(--| Node List |--+-------+--+-----------+---------------->
  1340.                                   |- NORM-|  '- CATSRC---'
  1341.                                   |- WORD-|
  1342.                                   |- NAME-|
  1343.                                   |- SINT-|
  1344.                                   |- DATE-|
  1345.                                   |- TIME-|
  1346.                                   '- UTC--'
  1347.  
  1348.         .- NOCATRES-.                             .- ERROR--.
  1349.      >--+-----------+--.-----------------------.--+---------+--)---------><
  1350.         '- CATRES---'  |  <-----------------<  |  |- WRAP---|
  1351.                        '----| Marker Pair |----'  |- TRUNC--|
  1352.                                                   '- IGNORE-'
  1353.  
  1354.      MARKER PAIR:
  1355.      |-- (signed_non-zero_integer signed_non-zero_integer)----------------|
  1356.  
  1357.      NODE LIST
  1358.          The list of nodes from which data will be selected.
  1359.  
  1360.      QUANTUM
  1361.          Represents the Quantum= attribute of the dataloc form.  This value
  1362.          defines what constitutes a quantum in the data.  Valid values are:
  1363.  
  1364.          NORM
  1365.              Normalized text:  all characters except record start (RS),
  1366.              record end (RE), and separation characters (SEPCHAR), normally
  1367.              space and tab.
  1368.  
  1369.          WORD
  1370.              Word tokens:  all name characters.
  1371.  
  1372.          NAME
  1373.              SGML name:  NAME constructed according to ISO 8879.
  1374.  
  1375.          SINT
  1376.              Signed integer:  digit string, optionally preceded by a hyphen
  1377.              or plus.
  1378.  
  1379.          DATE
  1380.              UTC date:  valid date in UTC yyy-mm-dd format.
  1381.  
  1382.          TIME
  1383.              UTC time:  valid time in UTC hh:mm:ss.decimal format.
  1384.  
  1385.          UTC
  1386.              UTC date and time: pairs of DATE and TIME tokens, DATE first.
  1387.  
  1388.          STR
  1389.              The data quantum is a bit combination ("character") and the
  1390.              addressable range is viewed as a string.  There is no
  1391.              filtering or normalization.  Addressing is always in terms of
  1392.              complete bit combinations.
  1393.  
  1394.      CATSRC
  1395.      NOCATSRC
  1396.          Concatenate source.  Concatenates the objects of a multiple
  1397.          location source into a single object before applying the dimension
  1398.          list to it.  The parsing context must be the same for all of the
  1399.          objects.
  1400.  
  1401.          Nocatsrc is the default.
  1402.  
  1403.      CATRES
  1404.      NOCATRES
  1405.          Determines whether or not the result of the query should be
  1406.          concatenated.
  1407.  
  1408.      MARKER PAIR
  1409.          One or more dimension marker pairs defining the location within
  1410.          the objects being located.
  1411.  
  1412.      OVERRUN
  1413.          Overrun handling specification as defined in 10744 7.1.2.1.  The
  1414.          overrun handling determines what action to take in the event that
  1415.          a dimension reference exceeds the size of the addressable range.
  1416.          Valid values are:
  1417.  
  1418.          ERROR
  1419.              Treat the overrun as an error condition.
  1420.  
  1421.          WRAP
  1422.              Wrap around the range modulo the length of the range.
  1423.  
  1424.          TRUNC
  1425.              Truncate either to the first or last quantum of the range.  If
  1426.              either marker is before the first quantum, it is treated as
  1427.              the first quantum.  If either marker is after the last
  1428.              quantum, it is treated as the last quantum.
  1429.  
  1430.          IGNORE
  1431.              Treat the dimension as though it had not been specified.  This
  1432.              may result in an error in some circumstances.
  1433.  
  1434.  
  1435.  
  1436.   Purpose
  1437.  
  1438.  
  1439.      Use dataloc() to locate data directly, rather than indirectly using
  1440.      some abstraction of the data (such as node lists.  See the entry for
  1441.      listloc() for a discussion of the difference between dataloc() and
  1442. |    listloc()).  For example, you could use dataloc() to locate data
  1443. |    within an ASCII text file or a string words within an SGML element.
  1444.      (See 10744 8.4.1 for more information using data locations).
  1445.  
  1446.  
  1447.   Examples
  1448.  
  1449.  
  1450. |    This example locates a segment of sound data within a sound object.
  1451. |    The returned sound data is used as the content of the Audio element
  1452. |    for presentation purposes:
  1453.  
  1454. |      <Audio notation=HyQ><!-- Returns data found with dataloc() -->
  1455. |      dataloc(oo(asound) (10 1000)
  1456. |      </Audio>
  1457.  
  1458. |    The object-of function is used to define the location source for the
  1459. |    query.  The value 'asound' in this example is the ID of another
  1460. |    element that refers to the actual audio data entity.  The marker pair
  1461. |    then locates that part of the sound starting at 10 and extending for
  1462. |    1000 quanta.  This example uses the defaults for the quantum, catsrc,
  1463.      catres, and overrun attributes.
  1464.  
  1465.      This next example uses dataloc to address into the content of an
  1466.      element.  The quantum value 'WORD' is used, meaning that the data will
  1467.      be divided into word quanta at each non-name character.
  1468.  
  1469.      The target element is:
  1470.  
  1471.        <phrase id=cats>Charles' and Linda's Abyssinians</phrase>
  1472.  
  1473.      The query to find the second and third words is:
  1474.  
  1475.        <NewPhrase notation=hyq>
  1476.        dataloc(oo(cats) word (2 2))
  1477.        </NewPhrase>
  1478.  
  1479.      The object-of function makes the element with the ID 'cats' the
  1480.      location source.  The marker pair '2 2' locates the second and third
  1481.      words (start at quantum 2 and extend for 2 quanta).  The resolved
  1482. |    content of the NewPhrase element is thus 'and Linda'.
  1483.  
  1484.  
  1485.   ------------------------------------------------------------------------------
  1486.   diff()
  1487.   Difference between nodelists
  1488.  
  1489.  
  1490.  
  1491.   Syntax
  1492.  
  1493.  
  1494.                <- -------------<
  1495.      >>--diff(---| Node List |---)---------------------------------------><
  1496.  
  1497.      NODE LIST
  1498.          The node lists to be compared.  The diff is applied by taking the
  1499.          diff of the first two node lists, then taking the diff the result
  1500.          with the next node list, and so on.
  1501.  
  1502.  
  1503.  
  1504.   Purpose
  1505.  
  1506.  
  1507.      Use Diff() to find the differences between two node lists.
  1508.  
  1509.  
  1510.   Examples
  1511.  
  1512.  
  1513.      In this simple example, two lists of literals are compared to find the
  1514.      differences.  In this example, the literals are element IDs.
  1515.  
  1516.        <HyQ>
  1517.        diff(("id-a" "id-b" "id-c") ("id-a" "id-c" "id-d"))
  1518.        </HyQ>
  1519.  
  1520. |    The result of the diff is 'id-b id-d'
  1521.  
  1522.  
  1523.   ------------------------------------------------------------------------------
  1524.   forall()
  1525.   Do all nodes meet assertion?
  1526.  
  1527.  
  1528.  
  1529.   Syntax
  1530.  
  1531.  
  1532.      >>--forall(-| Node List |- -| query() |-)---------------------------><
  1533.  
  1534.      NODE LIST
  1535.          The node list to apply the query against.
  1536.  
  1537.      QUERY()
  1538.          The query function that will be applied to each node in the node
  1539.          list.
  1540.  
  1541.  
  1542.  
  1543.   Purpose
  1544.  
  1545.  
  1546.      Forall() returns TRUE if all nodes in a node list satisfy a query.
  1547.  
  1548.  
  1549.   Examples
  1550.  
  1551.  
  1552.      In this example, a proploc query is used to determine whether or not
  1553.      all elements in the domain have an ID attribute value:
  1554.  
  1555.        forall(DOMTREE query(proploc(DOMROOT ATTVAL[ID]))
  1556.  
  1557.      The proploc() function returns the value of the ID attribute for the
  1558.      candidate node.  Because the proploc() function occurs where an
  1559.      assertion is expected, it will resolve to TRUE if the property value
  1560.      is not empty, FALSE if it is).  The forall() function will return TRUE
  1561.      if all the candidate nodes get a TRUE result from the query.
  1562.  
  1563.  
  1564.   ------------------------------------------------------------------------------
  1565.   hylex()
  1566.   Define a HyLex expression
  1567.  
  1568.  
  1569.  
  1570.   Syntax
  1571.  
  1572.  
  1573.                                       .- NORM--.
  1574.      >>--hylex((HyLex specification)--+--------+--.-------------------.--->
  1575.                                       '- UNORM-'  '- OO(lexord_idref)-'
  1576.  
  1577.      >--)----------------------------------------------------------------><
  1578.  
  1579.      HyLex Specification
  1580.          A pattern specification in the HyLex notation.  HyLex is similar
  1581.          to Unix regular expressions.  See 10744 Annex A.1 for more
  1582.          information about HyLex.
  1583.  
  1584.      NORM
  1585.      UNORM
  1586.          Indicates whether or not the target strings are normalized as for
  1587.          dataloc with the NORM option.  The default is normalization.
  1588.  
  1589.      OO(lexord_idref)
  1590.          Refers to a lexical ordering (lexord) element that defines the
  1591.          lexical ordering to be used for satisfying the HyLex pattern.  The
  1592.          default is to use the ordering of the active character set.
  1593.  
  1594.  
  1595.  
  1596.   Purpose
  1597.  
  1598.  
  1599.      Use HyLex() to define a HyLex pattern for use within a match()
  1600.      function.
  1601.  
  1602.  
  1603.   Examples
  1604.  
  1605.  
  1606.      This example uses HyLex within match() to see the target elements
  1607.      contain a US zip code:
  1608.  
  1609.        <HyQ>
  1610.        select(DOMTREE match(CAND HYLEX((digit, digit, digit, digit, digit,
  1611.                                             ("-",digit, digit, digit, digit)?)))
  1612.        </HyQ>
  1613.  
  1614.  
  1615.  
  1616.   ------------------------------------------------------------------------------
  1617.   inter()
  1618.   Intersection of node lists
  1619.  
  1620.  
  1621.  
  1622.   Syntax
  1623.  
  1624.  
  1625.                 <- -------------<
  1626.      >>--inter(---| Node List |---)--------------------------------------><
  1627.  
  1628.      NODE LISTS
  1629.          The node lists to take the intersection of.  The node list
  1630.          returned contains the nodes common to all node lists specified.
  1631.  
  1632.  
  1633.  
  1634.   Purpose
  1635.  
  1636.  
  1637.      Use inter() to find common members in two node lists.  This is useful
  1638.      for combining different queries.  For example, you might do one query
  1639.      that returns a list of nodes containing a certain string and another
  1640.      that returns a list matching a certain property.  You can use inter()
  1641.      to find the nodes common to both queries, thus finding the nodes with
  1642.      the property that contain the string.
  1643.  
  1644.  
  1645.   Examples
  1646.  
  1647.  
  1648.      This query creates two node lists and then finds the intersection of
  1649.      them:
  1650.  
  1651.        <HyQ>
  1652.        assign(PhraseList select(DOMTREE UseQ(HasGI "phrase")))
  1653.        assign(ContainsAIX select(DOMTREE match(CAND "AIX")))
  1654.        inter(nlref(PhraseList) nlref(ContainsAIX))
  1655.        <!-- Return all phrases that contain AIX -->
  1656.        </HyQ>
  1657.  
  1658.  
  1659.  
  1660.   ------------------------------------------------------------------------------
  1661.   listloc()
  1662.   Pick nodes from list by position
  1663.  
  1664.  
  1665.  
  1666.   Syntax
  1667.  
  1668.  
  1669.      >>--listloc(--| Node List |--.-----------------------.--------------->
  1670.                                   |  <-----------------<  |
  1671.                                   '----| Marker Pair |----'
  1672.  
  1673.         .- ERROR--.  .- NOSET-.
  1674.      >--+---------+--+--------+--)---------------------------------------><
  1675.         |- WRAP---|  '- SET---'
  1676.         |- TRUNC--|
  1677.         '- IGNORE-'
  1678.  
  1679.      MARKER PAIR:
  1680.      |-- (signed_non-zero_integer signed_non-zero_integer)----------------|
  1681.  
  1682.      NODE LIST
  1683.          The node list from which nodes will be returned according to the
  1684.          marker specifications.
  1685.  
  1686.      MARKER PAIRS
  1687.          One or more pairs of axis markers locating the nodes to be
  1688.          returned.
  1689.  
  1690.      OVERRUN
  1691.          Overrun handling specification as defined in 10744 7.1.2.1.  The
  1692.          overrun handling determines what action to take in the event that
  1693.          a dimension reference exceeds the size of the addressable range.
  1694.          Valid values are:
  1695.  
  1696.          ERROR
  1697.              Treat the overrun as an error condition.
  1698.  
  1699.          WRAP
  1700.              Wrap around the range modulo the length of the range.
  1701.  
  1702.          TRUNC
  1703.              Truncate either to the first or last quantum of the range.  If
  1704.              either marker is before the first quantum, it is treated as
  1705.              the first quantum.  If either marker is after the last
  1706.              quantum, it is treated as the last quantum.
  1707.  
  1708.          IGNORE
  1709.              Treat the dimension as though it had not been specified.  This
  1710.              may result in an error in some circumstances.
  1711.  
  1712.      SET
  1713.      NOSET
  1714.          Determines whether or not a multiple location is treated as a set
  1715.          by removing duplicates.  The default is NOSET.
  1716.  
  1717.  
  1718.  
  1719.   Purpose
  1720.  
  1721.  
  1722.      Use listloc() to locate nodes within a node list.  Listloc() is
  1723.      essentially the same as a dataloc, but is restricted to a single
  1724. |    dimension as node lists are always one dimensional.  Listloc() is also
  1725. |    distinquished from dataloc() by the type of quanta addressed.
  1726. |    Dataloc() addresses bit combinations or tokens, while listloc()
  1727. |    address nodes.  Nodes are, by their nature, an abstraction of a given
  1728. |    data notation, thus a node list is always the result of applying some
  1729. |    sort of abstracting processing against data (e.g., parsing it with an
  1730. |    SGML parser to find the element "nodes").  Note that any data type can
  1731. |    be abstracted into a node list by applying some sort of parser to it.
  1732. |    For example, raw video data could be addressed using dataloc, or it
  1733. |    could be abstracted into a node list of "frames" by first applying a
  1734. |    program that decoded the video data into frame chunks.
  1735.  
  1736. |    Another way to think of the difference between listloc() and dataloc()
  1737. |    is that while dataloc() operates on and returns the raw data,
  1738. |    listloc() operates on and returns sets of pointers to data.
  1739.  
  1740.  
  1741.   Examples
  1742.  
  1743.  
  1744.      This example uses dataloc to return the content of a node as a node
  1745.      list of words and then uses listloc to return the fourth through sixth
  1746.      nodes in the resulting list:
  1747.  
  1748.        <HyQ>
  1749.        listloc(dataloc(oo(an-element) word (1 -1)) (4 3))
  1750.        </HyQ>
  1751.  
  1752. |    The example shows how dataloc() abstracts the raw data (words) into
  1753. |    nodes, which can then be addressed as a node list by listloc().
  1754.  
  1755.  
  1756.   ------------------------------------------------------------------------------
  1757.   match()
  1758.   Pick nodes by pattern match of content
  1759.  
  1760.  
  1761.  
  1762.   Syntax
  1763.  
  1764.  
  1765.      >>--match(--.-| Node |------.--.- -| hylex() |----------------.------>
  1766.                  '-| Node List |-'  |- qualified_lexical_type_name-|
  1767.                                     '- literal---------------------'
  1768.  
  1769.                          .- ISCIEC--.
  1770.      >--.-------------.--+----------+--.------------------------.--)-----><
  1771.         '- OO(lexord)-'  |- SODEOD--|  '- minhits-.----------.--'
  1772.                          |- SODIEC--|             '- maxhits-'
  1773.                          |- ISCEOD--|
  1774.                          '- INMODEL-'
  1775.  
  1776.      NODE
  1777.      NODE LIST
  1778.          The node or node list against which the match is applied.  When a
  1779.          node list is specified, the match is applied against each node in
  1780.          the list.
  1781.  
  1782.      HYLEX()
  1783.      qualified_lexical_type_name
  1784.      LITERAL
  1785.          The pattern to be matched against.  Can be specified with the
  1786.          HyLex() function, by giving the name of a qualified lexical type,
  1787.          or by specifying a string literal.
  1788.  
  1789.      OO(lexord_idref)
  1790.          Refers to a lexical ordering (lexord) element that defines the
  1791.          lexical ordering to be used for satisfying the HyLex pattern.  The
  1792.          default is to use the ordering of the active character set.
  1793.  
  1794.      BOUNDARY CONSTRAINT
  1795.          These keywords define the boundary constraints for the hits as
  1796.          follows:
  1797.  
  1798.          ISCIEC
  1799.              Ignore starting characters, ignore ending characters.
  1800.              Indicates that the hit can be anywhere within the match
  1801.              domain.  This is the default.
  1802.  
  1803.          SODEOD
  1804.              Match start of domain and end of domain.  The hit must start
  1805.              at the start of the domain and end at the end of it.  For a
  1806.              literal string, the hit must match the domain.  For lexical
  1807.              types or HyLex patterns, the entire domain must satisfy the
  1808.              lexical constraints.
  1809.  
  1810.          SODIEC
  1811.              Match start of domain, ignore ending characters.  The hit must
  1812.              match the start of the domain.
  1813.  
  1814.          ISCEOD
  1815.              Ignore starting characters, match end of domain.
  1816.  
  1817.          INMODEL
  1818.              Indicates that the boundary constraints are defined in the
  1819.              HyLex lexical model or the model for the referenced lexical
  1820.              type.
  1821.  
  1822.      minhits maxhits
  1823.          Defines the hit range for the match, in other words the minimum
  1824.          and, optionally, maximum number of hits needed to satisfy the
  1825.          match.
  1826.  
  1827.  
  1828.  
  1829.   Purpose
  1830.  
  1831.  
  1832.      Use match to do patterning matching within a query.  The pattern
  1833.      matching mechanism can be one of the following:
  1834.  
  1835.      o   Simple string match, done by specifying a string literal, and
  1836.          optionally, the boundary constraints.
  1837.  
  1838.      o   HyLex pattern matching using a HyLex lexical model as defined in
  1839.          10744 Annex A.1., either by specifying the lexical model directly
  1840.          with a HyLex() function or by defining a lexical type elsewhere
  1841.          and specifying the lexical type name.
  1842.  
  1843.      o   A non-HyTime-defined pattern matching method using a pre-defined
  1844.          lexical type name defined using an application-defined notation
  1845.          (for example, grep regular expressions could be defined as a
  1846.          notaton and used via defined lexical type names).
  1847.  
  1848.  
  1849.  
  1850.   Examples
  1851.  
  1852.  
  1853.      This example uses match() with a literal string and a boundary
  1854.      constraint to find all phrase elements that start with the string
  1855.      'AIX'.
  1856.  
  1857.        <HyQ>
  1858.        match(UseQ(HasGI "phrase") "AIX" SODIEC)
  1859.        </HyQ>
  1860.  
  1861.  
  1862.  
  1863.   ------------------------------------------------------------------------------
  1864.   nl
  1865.   Nodelist-creating functions
  1866.  
  1867.  
  1868.  
  1869.   Syntax
  1870.  
  1871.  
  1872.      NL:
  1873.      |--.-DOMTREE------.--------------------------------------------------|
  1874.         |-DOMROOT------|
  1875.         |-| assign() |-|
  1876.         |-| nlref() |--|
  1877.         |-| nlops() |--|
  1878.         |-| nldefs() |-|
  1879.         |-| oo() |-----|
  1880.         '-| query() |--'
  1881.  
  1882.  
  1883.   Purpose
  1884.  
  1885.  
  1886.      Use nodelist-creating functions wherever a node list is valid.  The
  1887.      special keyword DOMTREE refers to all nodes rooted to the domain root.
  1888.      The special keyword DOMROOT refers to the node list that is the root
  1889.      of the domain.
  1890.  
  1891.  
  1892.   ------------------------------------------------------------------------------
  1893.   nldefs
  1894.   Nodelist-defining functions
  1895.  
  1896.  
  1897.  
  1898.   Syntax
  1899.  
  1900.  
  1901.      NL DEFS:
  1902.      |--.-| proploc() |-.-------------------------------------------------|
  1903.         |-| treeloc() |-|
  1904.         |-| pathloc() |-|
  1905.         |-| listloc() |-|
  1906.         |-| dataloc() |-|
  1907.         '-| relloc() |--'
  1908.  
  1909.  
  1910.   Purpose
  1911.  
  1912.  
  1913.      Nodelist-defining functions return a node list consisting of nodes
  1914.      selected from the input node list.
  1915.  
  1916.  
  1917.   ------------------------------------------------------------------------------
  1918.   nlops
  1919.   Nodelist-manipulating functions
  1920.  
  1921.  
  1922.  
  1923.   Syntax
  1924.  
  1925.  
  1926.      NL OPS:
  1927.      |--.-| select() |-.--------------------------------------------------|
  1928.         |-| create() |-|
  1929.         |-| union() |--|
  1930.         |-| inter() |--|
  1931.         '-| diff() |---'
  1932.  
  1933.  
  1934.   Purpose
  1935.  
  1936.  
  1937.      Node-list manipulating functions apply another function against the
  1938.      members of the input node list, returning a new node list containing
  1939.      those nodes from the input that satisfied the function.
  1940.  
  1941.  
  1942.   ------------------------------------------------------------------------------
  1943.   nlref()
  1944.   Resolves name to nodelist
  1945.  
  1946.  
  1947.  
  1948.   Syntax
  1949.  
  1950.  
  1951.      >>--nlref(nodelist_name)--------------------------------------------><
  1952.  
  1953.      nodelist_name
  1954.          The name of a node list previously created in the same query using
  1955.          the assign() function.
  1956.  
  1957.  
  1958.  
  1959.   Purpose
  1960.  
  1961.  
  1962.      Lets you use a node list by reference.
  1963.  
  1964.  
  1965.   Examples
  1966.  
  1967.  
  1968.      In this example, assign() used to create two node list names, which
  1969.      are then used by reference in the inter() function.
  1970.  
  1971.        <HyQ>
  1972.        assign(PhraseList select(DOMTREE UseQ(HasGI "phrase")))
  1973.        assign(ContainsAIX select(DOMTREE match(CAND "AIX")))
  1974.        inter(NLREF(PHRASELIST) nlref(ContainsAIX))
  1975.        <!-- Return all phrases that contain AIX -->
  1976.        </HyQ>
  1977.  
  1978.  
  1979.  
  1980.   ------------------------------------------------------------------------------
  1981.   Node
  1982.   Node specification methods
  1983.  
  1984.  
  1985.  
  1986.   Syntax
  1987.  
  1988.  
  1989.      NODE:
  1990.      |--.-"literal data"---------.----------------------------------------|
  1991.         |-CAND-------------------|
  1992.         |-| Argument Reference |-|
  1993.         |-| oo() |---------------|
  1994.         '-| count() |------------'
  1995.  
  1996.      "literal data"
  1997.          A node list of literals, such as IDs or other tokens.
  1998.  
  1999.      CAND
  2000.          The current candidate node within the context of a select()
  2001.          function.
  2002.  
  2003.      ARGUMENT REFERENCE
  2004.          Refers to a variable argument, e.g., %1, %2.
  2005.  
  2006.      OO()
  2007.          Object-of function.  Returns the node list of nodes corresponding
  2008.          the element or entity referred to in the body of oo().  When
  2009.          unified entity and ID name spaces are not being used, an entity
  2010.          can be referred by using a named location address that refers to
  2011.          an entity.
  2012.  
  2013.      COUNT()
  2014.          Returns a single integer value representing the number of quanta
  2015.          in an addressable range.
  2016.  
  2017.  
  2018.  
  2019.   Purpose
  2020.  
  2021.  
  2022.      Any of these node-specification methods are valid wherever a single
  2023.      node or node list is valid.
  2024.  
  2025.  
  2026.   ------------------------------------------------------------------------------
  2027.   not()
  2028.   Test Boolean NOT
  2029.  
  2030.  
  2031.  
  2032.   Syntax
  2033.  
  2034.  
  2035.      >>--not(-| Assertion |-)--------------------------------------------><
  2036.  
  2037.      ASSERTION
  2038.          Any of the assertion methods defined under Assertion.  All
  2039.          assertion methods return either TRUE or FALSE.
  2040.  
  2041.  
  2042.  
  2043.   Purpose
  2044.  
  2045.  
  2046.      Returns TRUE if the assertion is FALSE, returns FALSE if the assertion
  2047.      is TRUE.
  2048.  
  2049.  
  2050.   Examples
  2051.  
  2052.  
  2053.      This simple example always returns FALSE:
  2054.  
  2055.        <HyQ>
  2056.        not(assert(TRUE))
  2057.        </HyQ>
  2058.  
  2059.  
  2060.  
  2061.   ------------------------------------------------------------------------------
  2062.   oo()
  2063.   Resolves IDREF to its object
  2064.  
  2065.  
  2066.  
  2067.   Syntax
  2068.  
  2069.  
  2070.      >>--oo(element_ID)--------------------------------------------------><
  2071.  
  2072.      element_ID
  2073.          Returns as a node the element or entity referred to by the
  2074.          element_ID value.  When unified ID and entity name spaces are not
  2075.          used, oo() can refer to an entity by referring to a named location
  2076.          address (nameloc) that then refers to an entity.
  2077.  
  2078.  
  2079.  
  2080.   Purpose
  2081.  
  2082.  
  2083.      Use object-of to refer directly to elements for the purpose of
  2084.      defining the domain of a query.  When the ID and entity name space is
  2085.      unified, object-of can refer directly to a declared entity.  When the
  2086.      name spaces are not unified, entities can be refered to by using a
  2087.      named location address (nameloc) element to refer to the entity and
  2088.      then using object-of to refer to the nameloc element.
  2089.  
  2090.  
  2091.   Examples
  2092.  
  2093.  
  2094.      This example uses oo() to get an element to be the source for a
  2095.      dataloc() query that returns the content of the object:
  2096.  
  2097.        <HyQ>
  2098.        dataloc(OO(AN-ELEMENT) word (1 -1))
  2099.        </HyQ>
  2100.  
  2101.      The next example shows how to refer to an entity by using nameloc to
  2102.      create a location ladder that refers to an entity.  The dataloc() then
  2103.      addresses a portion of the graphic:
  2104.  
  2105.        <!-- In document's DTD subset: -->
  2106.        <!-- Define a graphic entity for later reference: -->
  2107.        <!ENTITY an-entity SYSTEM "filename.ext" NDATA graphic >
  2108.          .
  2109.          .
  2110.          .
  2111.        <!-- In the document proper: -->
  2112.        <nameloc id=entity-reference><nmlist entity>an-entity</nameloc>
  2113.        <HyQ>
  2114.        dataloc(OO(ENTITY-REFERENCE) str  (10 256)(35 1556)
  2115.        </HyQ>
  2116.  
  2117.  
  2118.  
  2119.   ------------------------------------------------------------------------------
  2120.   or()
  2121.   Test Boolean OR
  2122.  
  2123.  
  2124.  
  2125.   Syntax
  2126.  
  2127.  
  2128.              <---------------<
  2129.      >>--or(---| Assertion |---)-----------------------------------------><
  2130.  
  2131.      ASSERTION
  2132.          Any of the assertion methods defined under Assertion.  All
  2133.          assertion methods return either TRUE or FALSE.
  2134.  
  2135.  
  2136.  
  2137.   Purpose
  2138.  
  2139.  
  2140.      OR returns TRUE if any of the assertions are TRUE, and FALSE if all of
  2141.      them are false:
  2142.  
  2143.  
  2144.   Examples
  2145.  
  2146.  
  2147.      This example returns true if either attribute value matches the
  2148.      specified values:
  2149.  
  2150.        <HyQ>
  2151.        select(DOMTREE OR(EQ(proploc(CAND ATTVAL[HWPLATFORM]) "PS/2")
  2152.                          EQ(proploc(CAND ATTVAL[SWPLATFORM]) "AIX")))
  2153.        </HyQ>
  2154.  
  2155.  
  2156.  
  2157.   ------------------------------------------------------------------------------
  2158.   ordered()
  2159.   Tests if nodes are properly ordered
  2160.  
  2161.  
  2162.  
  2163.   Syntax
  2164.  
  2165.  
  2166. |    >>--ordered(--| Node List |--.-----------.--)-----------------------><
  2167.                                   |-OVERLAP---|
  2168.                                   '-NOOVERLAP-'
  2169.  
  2170.      OVERLAP
  2171.      NOOVERLAP
  2172.          Indicates whether or not the nodes can overlap.
  2173.  
  2174.  
  2175.  
  2176.   Purpose
  2177.  
  2178.  
  2179.      Returns TRUE if all the nodes have the same additional property source
  2180.      (apropsrc, see 10744 8.5.1: Property location address) and are ordered
  2181.      within it.  The additional property source is the common container for
  2182.      all the nodes.
  2183.  
  2184.  
  2185.   Examples
  2186.  
  2187.  
  2188.      The following query returns TRUE:
  2189.  
  2190.        <HyQ>
  2191. |      ordered(('1' '2' '3' '4'))
  2192.        </HyQ>
  2193.  
  2194.  
  2195.  
  2196.   ------------------------------------------------------------------------------
  2197.   pathloc()
  2198.   Pick nodes from tree by paths
  2199.  
  2200.  
  2201.  
  2202.   Syntax
  2203.  
  2204.  
  2205.      >>--pathloc(--| Node List |--.-----------------------.--------------->
  2206.                                   |  <-----------------<  |
  2207.                                   '----| Marker Pair |----'
  2208.  
  2209.                                   .- NTREECOM-.
  2210.         .- ERROR--.  .- NOTSET-.  |- TREECOM--|
  2211.      >--+---------+--+---------+--'-----------'--)-----------------------><
  2212.         |- WRAP---|  '- SET----'
  2213.         |- TRUNC--|
  2214.         '- IGNORE-'
  2215.  
  2216.      NODE LIST
  2217.          The tree being addressed.
  2218.  
  2219.      MARKER PAIRS
  2220.          Two or more sets of marker pairs locating the path within the
  2221.          tree.
  2222.  
  2223.      OVERRUN
  2224.          Overrun handling specification as defined in 10744 7.1.2.1.  The
  2225.          overrun handling determines what action to take in the event that
  2226.          a dimension reference exceeds the size of the addressable range.
  2227.          Valid values are:
  2228.  
  2229.          ERROR
  2230.              Treat the overrun as an error condition.
  2231.  
  2232.          WRAP
  2233.              Wrap around the range modulo the length of the range.
  2234.  
  2235.          TRUNC
  2236.              Truncate either to the first or last quantum of the range.  If
  2237.              either marker is before the first quantum, it is treated as
  2238.              the first quantum.  If either marker is after the last
  2239.              quantum, it is treated as the last quantum.
  2240.  
  2241.          IGNORE
  2242.              Treat the dimension as though it had not been specified.  This
  2243.              may result in an error in some circumstances.
  2244.  
  2245.      SET
  2246.      NOTSET
  2247.          Determines whether or not the result node list is treated as a set
  2248.          by removing duplicates.
  2249.  
  2250.      TREECOM
  2251.      NTREECOM
  2252.          Determines whether or not multiple source trees are combined.  The
  2253.          default is no combination.
  2254.  
  2255.  
  2256.  
  2257.   Purpose
  2258.  
  2259.  
  2260.      Pathloc locates into a tree as though it were a matrix where each
  2261.      column consists of each node from the root to one leaf.
  2262.  
  2263.  
  2264.   Examples
  2265.  
  2266.  
  2267.      This query locates the path from the root to the second leaf of the
  2268.      tree:
  2269.  
  2270.        <HyQ>
  2271.        pathloc(DOMTREE (2 1 1 -1))
  2272.        </HyQ>
  2273.  
  2274.      By using the SET parameter, you can remove the duplicates created by
  2275.      locating more than one path:
  2276.  
  2277.        <HyQ>
  2278.        pathloc(DOMTREE (2 2 2 4) SET)
  2279.        </HyQ>
  2280.  
  2281.  
  2282.  
  2283.   ------------------------------------------------------------------------------
  2284.   proploc()
  2285.   Returns value of a property
  2286.  
  2287.  
  2288.  
  2289.   Syntax
  2290.  
  2291.  
  2292.      >>--proploc(--.-| Node |------.-- qualified_property_name------------>
  2293.                    '-| Node List |-'
  2294.  
  2295.         .- SEVERAL-.  .- SOLESRC--.  .- IGNORE-.
  2296.      >--+----------+--+-----------+--+---------+--)----------------------><
  2297.         '- JOINT---'  '- APROPSRC-'  |- ERROR--|
  2298.                                      '- EMPTY--'
  2299.  
  2300.      NODE
  2301.      NODE LIST
  2302.          The node or node list from which property values are to be
  2303.          retrieved.
  2304.  
  2305.      qualified_property_name
  2306.          The name of the property to be retrieved.  For SGML attributes,
  2307.          this is simply the name of the attribute.  The keyword 'GI'
  2308.          returns the generic identifier of the element.  Other properties
  2309.          can be defined using HyTime property definitions (see 10744 6.7
  2310.          Property sets and A.2 HyTime Property definition).
  2311.  
  2312.      JOINT
  2313.      SEVERAL
  2314.          Determines whether or not the property applies to to all the nodes
  2315.          in the source node list jointly or to each node individually.  The
  2316.          default is SEVERAL
  2317.  
  2318.      SOLESRC
  2319.      APROPSRC
  2320.          Indicates whether or not to consider an additional property source
  2321.          if the property is not applicable to the defined source.
  2322.  
  2323.      IGNORE
  2324.      EMPTY
  2325.      ERROR
  2326.          Determines the behavior in the case where the property is not a
  2327.          property of the source node.  When IGNORE is specified, the
  2328.          proploc is treated as though it didn't exist.  When EMPTY is
  2329.          specified, an empty node is returned.  When ERROR is specified it
  2330.          is an error condition.
  2331.  
  2332.  
  2333.  
  2334.   Purpose
  2335.  
  2336.  
  2337.      Use proploc() to get the value of various properties of nodes, such as
  2338.      the values of attributes of SGML elements.  The value is returned as a
  2339.      string literal.
  2340.  
  2341.  
  2342. | Examples
  2343.  
  2344.  
  2345.      This query returns the value of the GI property of the source element:
  2346.  
  2347.        <HyQ>
  2348.        proploc(oo(an-element) GI)
  2349.        </HyQ>
  2350.  
  2351.  
  2352.  
  2353.   ------------------------------------------------------------------------------
  2354.   query()
  2355.   specifies a query with args
  2356.  
  2357.  
  2358.  
  2359.   Syntax
  2360.  
  2361.  
  2362.      >>--query(--| Query Body |------------------------------------------->
  2363.  
  2364.      >--.---------------------------------------.--)---------------------><
  2365.         '-| Query Domain |--| Query Arguments |-'
  2366.  
  2367.      QUERY BODY:
  2368.      |--| Node List |-----------------------------------------------------|
  2369.  
  2370.      QUERY DOMAIN:
  2371.         .-DOMROOT-------.
  2372.      |--+---------------+-------------------------------------------------|
  2373.         '-| Node List |-'
  2374.  
  2375.      QUERY ARGUMENTS:
  2376.         <----------<
  2377.      |----| Node |--------------------------------------------------------|
  2378.  
  2379.      QUERY BODY
  2380.          The query itself, defined using normal HyQ primitives.
  2381.  
  2382.      QUERY DOMAIN
  2383.          The domain against which the query is applied.
  2384.  
  2385.      QUERY ARGUMENTS
  2386.          Arguments to be passed to the query body as though specified on
  2387.          the args= attribute of the HyQ element.
  2388.  
  2389.  
  2390.  
  2391.   Purpose
  2392.  
  2393.  
  2394.      Query() lets you define a query with replaceable arguments and then
  2395.      call it directly, rather than indirectly via the UseQ function.  The
  2396.      difference between query() and UseQ() is that with UseQ() the function
  2397.      body is refered to indirectly and may be defined elsewhere, while with
  2398.      query(), the function body is defined within the query() function
  2399.      itself.
  2400.  
  2401.  
  2402.   Examples
  2403.  
  2404.  
  2405.      This example defines a simple query with one argument and then uses
  2406.      query() to apply it against the specified query domain, returning a
  2407.      node list containing the value of the Security= attribute for each
  2408.      node in DOMTREE:
  2409.  
  2410.        query(proploc(%1 ATTVAL[SECURITY]) DOMTREE)
  2411.  
  2412.  
  2413.  
  2414.   ------------------------------------------------------------------------------
  2415.   relloc()
  2416.   Pick nodes from tree by relatives
  2417.  
  2418.  
  2419.  
  2420.   Syntax
  2421.  
  2422.  
  2423.                                                        .- PARENT---.
  2424.      >>--relloc(--| Node List |-- --.-| Node |------.--+-----------+------>
  2425.                                     '-| Node List |-'  |- ANC------|
  2426.                                                        |- ESIB-----|
  2427.                                                        |- YSIB-----|
  2428.                                                        |- DES------|
  2429.                                                        '- CHILDREN-'
  2430.  
  2431.                                    .- ERROR--.  .- NOTSET-.
  2432.      >--.-----------------------.--+---------+--+---------+--)-----------><
  2433.         |  <-----------------<  |  |- WRAP---|  '- SET----'
  2434.         '----| Marker Pair |----'  |- TRUNC--|
  2435.                                    '- IGNORE-'
  2436.  
  2437. |    NODE LIST
  2438. |        The node or node list whose relatives are to be located.
  2439.  
  2440. |    NODE | NODE LIST
  2441. |        The root of tree within against which the relloc() is performed,
  2442. |        normally, DOMROOT.
  2443.  
  2444.      RELATION:
  2445.  
  2446.          ANC
  2447.              Ancestors of source.
  2448.  
  2449.          ESIB
  2450.              Elder siblings of source.
  2451.  
  2452.          YSIB
  2453.              Younger siblings of source.
  2454.  
  2455.          DES
  2456.              Descendants of source. Addressed as for pathloc().
  2457.  
  2458.          PARENT
  2459.              Parent of source.  Equivalent of ANC with a dimlist of (-1 1).
  2460.              Actual dimlist must be empty.
  2461.  
  2462.          CHILDREN
  2463.              Children of source.  Equivalent of DES with a dimlist of (1 -1
  2464.              2 1).  Actual dimlist must be empty.
  2465.  
  2466.      MARKER PAIRS
  2467.          Sets of axis markers locating elements within the set of elements
  2468.          identified by the relationship keyword.  Cannot be specified for
  2469.          PARENT or CHILDREN relationships.
  2470.  
  2471.      OVERRUN
  2472.          Overrun handling specification as defined in 10744 7.1.2.1.  The
  2473.          overrun handling determines what action to take in the event that
  2474.          a dimension reference exceeds the size of the addressable range.
  2475.          Valid values are:
  2476.  
  2477.          ERROR
  2478.              Treat the overrun as an error condition.
  2479.  
  2480.          WRAP
  2481.              Wrap around the range modulo the length of the range.
  2482.  
  2483.          TRUNC
  2484.              Truncate either to the first or last quantum of the range.  If
  2485.              either marker is before the first quantum, it is treated as
  2486.              the first quantum.  If either marker is after the last
  2487.              quantum, it is treated as the last quantum.
  2488.  
  2489.          IGNORE
  2490.              Treat the dimension as though it had not been specified.  This
  2491.              may result in an error in some circumstances.
  2492.  
  2493.      SET
  2494.      NOTSET
  2495.          Determines whether or not the result node list is treated as a set
  2496.          by removing duplicates.
  2497.  
  2498.  
  2499.  
  2500.   Purpose
  2501.  
  2502.  
  2503.      Use relloc() to construct queries about nodes based on their
  2504.      genealogical relationships to other nodes.
  2505.  
  2506.  
  2507.   Examples
  2508.  
  2509.  
  2510.      The following query locates the second path from the source node to
  2511.      the the bottom of the tree:
  2512.  
  2513.        <HyQ>
  2514. |      relloc(oo(an-element) DOMROOT DES (2 1 1 -1))
  2515.        </HyQ>
  2516.  
  2517.  
  2518.  
  2519.   ------------------------------------------------------------------------------
  2520.   select()
  2521.   Select nodes from list by assertion
  2522.  
  2523.  
  2524.  
  2525.   Syntax
  2526.  
  2527.  
  2528.      >>--select(--| Node List |-- --| Assertion |--)---------------------><
  2529.  
  2530.      NODE LIST
  2531.          The list of nodes from which the result node list will be
  2532.          selected.
  2533.  
  2534.      ASSERTION
  2535.          Any of the assertion functions.  The assertion is applied to each
  2536.          node in the source node list, and any node for which the assertion
  2537.          evaluates to TRUE will be returned in the result node list.
  2538.  
  2539.  
  2540.  
  2541.   Purpose
  2542.  
  2543.  
  2544.      Use select() to select nodes out of a node list.
  2545.  
  2546.      Within the context of select(), the keyword CAND refers to the current
  2547.      candidate node in source node list.  When select() is nested within a
  2548.      select, CAND refers to nodes in the node list of the innermost select
  2549.      that contains the query using CAND.
  2550.  
  2551.      If you need to use the value of an outer CAND within the body of a
  2552.      nested select, you can use assign() to assign CAND to a symbolic name
  2553.      and then use nlref() within the nested select to refer to the assigned
  2554.      name.
  2555.  
  2556.  
  2557.   Examples
  2558.  
  2559.  
  2560.      This example selects from the domain tree all nodes whose GI is equal
  2561.      to the value "partnum":
  2562.  
  2563.        <HyQ>
  2564.        select(DOMTREE EQ(proploc(CAND GI) "partnum"))
  2565.        </HyQ>
  2566.  
  2567.      In this example, assign() is used to capture the value of CAND for use
  2568.      in a nested select.  The query compares the value of the security=
  2569.      attribute of containing Section elements with the security= value of
  2570.      footnotes within the Section:
  2571.  
  2572.        <HyQ>
  2573.        Select(DOMTREE
  2574.               and(Eq(Proploc(CAND GI) "SECTION")
  2575.                   ASSIGN(CURSECTION CAND)
  2576.                   Select(PATHLOC((CAND) 1 -1 2 -1)'
  2577.                          and(Eq(Proploc(CAND GI) "FOOTNOTE")
  2578.                              Le(Proploc(CAND ATTVAL[SECURITY])
  2579.                                 Proploc(NLREF(CURSECTION)
  2580.                                                        ATTVAL[SECURITY])
  2581.                         )
  2582.                  )
  2583.              )
  2584.        </HyQ>
  2585.  
  2586.  
  2587.  
  2588.   ------------------------------------------------------------------------------
  2589.   treeloc()
  2590.   Pick nodes from tree by position
  2591.  
  2592.  
  2593.  
  2594.   Syntax
  2595.  
  2596.  
  2597.                                   <------------------------<
  2598.      >>--treeloc(--| Node List |--- signed_non-zero_integer--------------->
  2599.  
  2600.                                   .- NTREECOM-.
  2601.         .- ERROR--.  .- NOTSET-.  |- TREECOM--|
  2602.      >--+---------+--+---------+--'-----------'--)-----------------------><
  2603.         |- WRAP---|  '- SET----'
  2604.         |- TRUNC--|
  2605.         '- IGNORE-'
  2606.  
  2607.      NODE LIST
  2608.          The root node(s) of the tree to which the treeloc() applies.
  2609.  
  2610.      SIGNED_NON-ZERO_INTEGERS
  2611.          The number of each ancestor node at each level of the tree.  Each
  2612.          number is essentially a listloc of the form (x 1), locating a
  2613.          single node in the node list of children of the previous node.
  2614.  
  2615.      OVERRUN
  2616.          Overrun handling specification as defined in 10744 7.1.2.1.  The
  2617.          overrun handling determines what action to take in the event that
  2618.          a dimension reference exceeds the size of the addressable range.
  2619.          Valid values are:
  2620.  
  2621.          ERROR
  2622.              Treat the overrun as an error condition.
  2623.  
  2624.          WRAP
  2625.              Wrap around the range modulo the length of the range.
  2626.  
  2627.          TRUNC
  2628.              Truncate either to the first or last quantum of the range.  If
  2629.              either marker is before the first quantum, it is treated as
  2630.              the first quantum.  If either marker is after the last
  2631.              quantum, it is treated as the last quantum.
  2632.  
  2633.          IGNORE
  2634.              Treat the dimension as though it had not been specified.  This
  2635.              may result in an error in some circumstances.
  2636.  
  2637.      SET
  2638.      NOTSET
  2639.          Determines whether or not the result node list is treated as a set
  2640.          by removing duplicates.
  2641.  
  2642.      TREECOM
  2643.      NTREECOM
  2644.          Determines whether or not multiple source trees are combined.  The
  2645.          default is no combination.
  2646.  
  2647.  
  2648.  
  2649.   Purpose
  2650.  
  2651.  
  2652.      Use treeloc() to locate single nodes within a tree.  Treeloc() is a
  2653.      very compact way to locate nodes within trees.  For example, using the
  2654.      sample tree shown under "Nodelist and Tree Addressing" on page i, the
  2655.      tree location (3 2) locates the node labeled "I", while the tree
  2656.      location (1 2 1) locates the node labeled "J".
  2657.  
  2658.  
  2659.   Examples
  2660.  
  2661.  
  2662.      The following example uses relloc() to locate the children of DOMROOT
  2663.      and then uses treeloc() to find the first child of the second child of
  2664.      each child of DOMROOT:
  2665.  
  2666.        <HyQ>
  2667.        treeloc(relloc(DOMROOT CHILDREN) 2 1 NTREECOM)
  2668.        </HyQ>
  2669.  
  2670.      The NTREECOM keyword states explicitly that for the node list returned
  2671.      by relloc(), each node should be treated as the root of a separate
  2672.      tree.
  2673.  
  2674.  
  2675.   ------------------------------------------------------------------------------
  2676.   union()
  2677.   Union of Node Lists
  2678.  
  2679.  
  2680.  
  2681.   Syntax
  2682.  
  2683.  
  2684.                 <---------------<
  2685.      >>--union(---| Node List |---)--------------------------------------><
  2686.  
  2687.      NODE LISTS
  2688.          The node lists to be combined.
  2689.  
  2690.  
  2691.  
  2692.   Purpose
  2693.  
  2694.  
  2695.      Takes two or more node lists and combines them into a single node
  2696.      list, removing any duplicates.
  2697.  
  2698.  
  2699.   Examples
  2700.  
  2701.  
  2702.      This example uses two proploc() functions to create two node lists of
  2703.      elements with specific GIs, and then uses union() to combine the two
  2704.      lists into one:
  2705.  
  2706.        <HyQ>
  2707.        union(select(DOMTREE eq(proploc(CAND GI) "CAUTION"))
  2708.              select(DOMTREE eq(proploc(CAND GI) "WARNING")))
  2709.        </HyQ>
  2710.  
  2711.  
  2712.  
  2713.   ------------------------------------------------------------------------------
  2714.   UseQ()
  2715.   Indirect query
  2716.  
  2717.  
  2718.  
  2719.   Syntax
  2720.  
  2721.  
  2722.      >>--useq(--function_name--------------------------------------------->
  2723.  
  2724.      >--.---------------------------------------.--)---------------------><
  2725.         '-| Query Domain |--| Query Arguments |-'
  2726.  
  2727.      QUERY DOMAIN:
  2728.         .-DOMROOT-------.
  2729.      |--+---------------+-------------------------------------------------|
  2730.         '-| Node List |-'
  2731.  
  2732.      QUERY ARGUMENTS:
  2733.         <----------<
  2734.      |----| Node |--------------------------------------------------------|
  2735.  
  2736.      function-name
  2737.          The name of a HyQ function defined elsewhere using the FN=
  2738.          attribute of the HyQ element.
  2739.  
  2740.      QUERY DOMAIN
  2741.          The domain against which the named query is applied.  The default
  2742.          is DOMROOT.
  2743.  
  2744.      QUERY ARGUMENTS
  2745.          A node or node list containing the arguments to the named query.
  2746.  
  2747.  
  2748.  
  2749.   Purpose
  2750.  
  2751.  
  2752.      Use UseQ() to use pre-defined functions.
  2753.  
  2754.  
  2755.   Examples
  2756.  
  2757.  
  2758.      This example defines a new function, called Has_Attribute_Value, which
  2759.      takes an attribute name and value and returns TRUE if the node's
  2760.      attribute has the value.  This function is then used in a subsequent
  2761.      query.
  2762.  
  2763.        <HyQ fn="Has_Attribute_Value">
  2764.        <!-- Arguments: qdomain attname attvalue -->
  2765.        EQ(proploc(%1 %2) %3)
  2766.        </HyQ>
  2767.        <!-- Now use this function in another query: -->
  2768.        <HyQ>
  2769.        select(DOMTREE USEQ(Has_Attribute_Value CAND ATTVAL[SECURITY] "IUO"))
  2770.        </HyQ>
  2771.  
  2772. Footnotes:
  2773.  
  2774. | (1) The simplest application of multi-dimensional address is through of use of
  2775. |     finite coordinate space location elements (fcsloc), which provide a
  2776. |     mechanism for imposing a finite coordinate space onto an object for the
  2777. |     purpose of then locating areas within the object.  For example, one way to
  2778. |     define hot spots within bitmap images would be to use fcsloc elements to
  2779. |     define rectangular regions within the image.
  2780.  
  2781. |     The other application of multi-dimentional addressing is to define the
  2782. |     location of objects (called events) within a finite coordinate space using
  2783. |     an indirection method called an event schedule The purpose of an event
  2784. |     schedule is to associate objects with locations within a coordinate space of
  2785. |     one or more dimensions.  The subject of event schedules and finite
  2786. |     coordinate spaces is beyond the scope of this document.  For now, just
  2787. |     remember that an extent list contains one set of dimension specifications (a
  2788. |     dimlist) for each axis in the finite coordinate space.
  2789.  
  2790.   (2) SGML documents can also be represented as one-dimensional coordinate spaces
  2791.       with the quanta representing SGML elements in the order they are encountered
  2792.  
  2793. | (3) See section 6.7 Property Sets for the definition of HyTime's property set
  2794. |     elements
  2795.  
  2796.   (4) Note that the GI property is one of the standard properties and so the
  2797.       property set name specification can be omitted, as it is in this example
  2798.